/*
 * gen.c
 *
 * Implements a code generation backend that emits C code.
 */



#include "gen_backend_c.h"
#include "error.h"
#include "gen.h"



void gen_backend_c(struct lir_t *lir)
{

}



/* Returns the size of a primitive type for this backend */
long gen_backend_c_primitive_size(char *primitive_type)
{
  if (strcmp(primitive_type, PRIMITIVE_TYPE_NAME_INTEGER) == 0)
    return BACKEND_C_PRIMITIVE_TYPE_SIZE_INTEGER;
  else if (strcmp(primitive_type, PRIMITIVE_TYPE_NAME_BOOLEAN) == 0)
    return BACKEND_C_PRIMITIVE_TYPE_SIZE_BOOLEAN;
  else if (strcmp(primitive_type, PRIMITIVE_TYPE_NAME_POINTER) == 0)
    return BACKEND_C_PRIMITIVE_TYPE_SIZE_POINTER;
  else
    return GEN_BACKEND_PRIMITIVE_TYPE_SIZE_UNKNOWN;
}
